#include<bits/stdc++.h>
using namespace std;
namespace IO
{
	template<typename T>
	void read(T &_x){_x=0;int _f=1;char ch=getchar();while(!isdigit(ch)) _f=(ch=='-'?-1:_f),ch=getchar();while(isdigit(ch)) _x=_x*10+(ch^48),ch=getchar();_x*=_f;}
	template<typename T,typename... Args>
	void read(T &_x,Args&...others){Read(_x);Read(others...);}
	const int BUF=20000000;char buf[BUF],to,stk[32];int plen;
	#define pc(x) buf[plen++]=x
	#define flush(); fwrite(buf,1,plen,stdout),plen=0;
	template<typename T>inline void print(T x){if(!x){pc(48);return;}if(x<0) x=-x,pc('-');for(;x;x/=10) stk[++to]=48+x%10;while(to) pc(stk[to--]);}
}
using namespace IO;
const int N = 1e5+10,M = 310;
int n,m,f[M][M],l[N],st[N],cnt,o,o1;
string s,t;
signed main()
{
	freopen("seq.in","r",stdin);
	freopen("seq.out","w",stdout);
	cin >> s >> t; n = s.size(),m = t.size(); s = ' '+s; t = ' '+t;
	if(n <= 300 && m <= 300)
	{
		for(int i = 1;i <= n;i++)
			if(s[i] == s[i-1]) l[i] = l[i-1];
			else l[i] = i;
		for(int i = 0;i <= n;i++)
			for(int j = 0;j <= m;j++)
				f[i][j] = -1;
		f[0][0] = 0; l[0] = 1; o = 1;
		for(int i = 1;i <= n;i++)
		{
			o = min(i,m);
			for(int j = 1;j <= o;j++)
				if(s[i] == t[j])
					for(int z = i;i >= l[i-1];z--)
						if(f[z-1][j-1] != -1)
						{
							f[i][j] = z-1;
							break;
						}
		}
		for(int i = l[n]-1;i <= n;i++)
			if(f[i][m] != -1)
			{
				while(i != 0) st[++cnt] = i,i = f[i][m],m--;
				sort(st+1,st+1+cnt);
				pc('Y'),pc('E'),pc('S'),pc('\n');
				for(int i = 1;i <= cnt;i++) print(st[i]),pc(' ');
				flush();
				return 0;
			}
		printf("NO");
		return 0;
	}
	o = 1; o1 = 1;
	while(o1 <= n)
	{
		while(s[o1] != t[o] && o1 <= n) o1++;
		if(o1 > n) break;
		st[++cnt] = o1,o++,o1++;
	} 
	if(cnt == m) 
	{
		pc('Y'),pc('E'),pc('S'),pc('\n');
		for(int i = 1;i <= cnt;i++) print(st[i]),pc(' ');
		flush();
	}
	else printf("NO");
	return 0;
}
/*
0  1
11101001101110
1001
*/
